<html xmlns:th="http://www.thymeleaf.org">
	<input type="hidden" id="id" name="id" th:value="${sysMenu.id}">
	<input type="hidden" id="clientId" name="clientId" th:value="${sysMenu.clientId}">
	<table class="editTable">
		<thead>
			<tr>
				<td colspan="8">
					 <div class="divider">
						 <span> 基本信息</span>
					 </div>
				 </td>
			</tr>
			<tr>
				<th class="label" width="8%"><span class="span_red">*</span>菜单名称</th>
				<td width="42%">
					<input type="text" name="name" data-toggle="topjui-textbox"
						   data-options="required:true,validateOnCreate:false,width:250" th:value="${sysMenu.name}">
				</td>
				 <th class="label" width="8%"><span class="span_red">*</span>菜单编码</th>
				<td width="42%">
					<input type="text" name="code" data-toggle="topjui-textbox"
						   data-options="required:true,validateOnCreate:false,width:250" th:value="${sysMenu.code}">
				</td>
			</tr>
			<tr>
				<th class="label" width="8%"><span class="span_red">*</span>菜单URL</th>
				<td width="42%">
					<input type="text" name="url" data-toggle="topjui-textbox"
						   data-options="required:true,width:250" th:value="${sysMenu.url}">
				</td>
				<th class="label" width="8%"><span class="span_red">*</span>菜单图标</th>
				<td width="42%">
					<input type="text" name="icon" data-toggle="topjui-textbox"
						   data-options="required:true,width:250" th:value="${sysMenu.icon}">
				</td>
			</tr>
			<tr>
				<th class="label" width="8%">父菜单</th>
				<td width="42%">
					<!--<input type="hidden" name="pid">-->
					<input type="text" name="pid" th:value="${sysMenu.pid}"
						   data-toggle="topjui-combotree">
				</td>
				<th class="label" >状态</th>
				<td>
					<div data-toggle="topjui-radio">
						<input type="hidden" id="sysMenuStatus" th:value="${sysMenu.status}" >
						<input type="radio" name="status" value="ENABLE" label="启用">
						<input type="radio" name="status" value="DISABLE" label="禁用">
					</div>
				</td>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<th class="label" >说明</th>
				<td colspan="3">
					<input type="text" name="comment" data-toggle="topjui-textbox" style="width: 94%;" th:value="${sysMenu.comment}">
				</td>
			</tr>
		</thead>
	</table>

	<script th:inline="javascript">
        /**
		 * 菜单状态设置
         */
		var status = $("#sysMenuStatus").val();
		var radios = $(".editTable").find("input[name='status']");
		if (status == "DISABLE") {
            $(radios[1]).attr("checked","checked");
		} else {
            $(radios[0]).attr("checked","checked");
		}

		//TODO: 获取项目上下文路径，记得需要在<script>标签中加入  th:inline="javascript" 属性配置，才可正常解析
        /*<![CDATA[*/
        var contextPath = /*[[@{/}]]*/;
        /*]]>*/

        /**
		 * 动态设置父菜单的url
         */
        $(document).ready(function () {
            //var id = [[${sysMenu.id}]];
			$("input[name='pid']").attr("data-options","required:true,prompt:'必填',width:250,textField:'name'," +
				"url:'" + contextPath + "menu/list/not/itself/" + $("#id").val() + "/" + $("#clientId").val() + "'");
        });
	</script>

</html>